package org.springblade.modules.admin.controller.suger;
import cn.hutool.json.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.tenant.annotation.TenantIgnore;
import org.springblade.core.tool.api.R;
import org.springblade.modules.admin.dto.sugar.EstateTlwGeneralDTO;
import org.springblade.modules.admin.dto.tlw.TlwRescuePlanChangeStateDTO;
import org.springblade.modules.admin.service.suger.IEstateTlwScreenService;
import org.springblade.modules.admin.utils.TlwR;
import org.springframework.web.bind.annotation.*;

/**
 * @Description 物业大屏-梯联网
 * @Author ysq
 * @Date 2022/12/26
 **/
@RestController
@RequestMapping("/estate/tlw/screen")
@AllArgsConstructor
@Api(value = "物业大屏-梯联网", tags = "物业大屏-梯联网")
public class EstateTlwScreenController {

	private final IEstateTlwScreenService estateTlwScreenService;

	@GetMapping("/general")
	@ApiOperation(value = "梯联网概况")
	public JSONObject general(EstateTlwGeneralDTO estateTlwGeneralDTO) {
		return TlwR.data(estateTlwScreenService.general(estateTlwGeneralDTO));
	}

	@TenantIgnore
	@PostMapping("/rescue/plan/change/state")
	@ApiOperation(value = "救援工单-更新工单状态")
	public R<Boolean> rescuePlanChangeState(@RequestBody TlwRescuePlanChangeStateDTO param) {
		estateTlwScreenService.rescuePlanChangeState(param);
		return R.data(Boolean.TRUE);
	}
}
